package com.cj.cms.web;

import org.springframework.beans.factory.annotation.Autowired;

import com.cj.cms.entity.WebSite;
import com.cj.cms.service.WebSiteManager;
import com.cj.common.web.struts2.BaseActionSupport;

public class LoginMessageAction extends BaseActionSupport{
	private WebSite webSite;
	@Autowired
	private WebSiteManager webSiteManager;
	@Override
	public String execute() throws Exception {
		try {
			webSite = webSiteManager.getAll().get(0);
			if(super.getCurrentUserName() == null || super.getCurrentUserName().equalsIgnoreCase("roleAnonymous"))
				return "fail";
			return SUCCESS;
		} catch (Exception e) {
			setErrMessage(e.getMessage(), e);
			return ERROR;
		}
	}
	
	public String tdjd(){
		try {
			webSite = webSiteManager.getAll().get(0);
			if(super.getCurrentUserName() == null || super.getCurrentUserName().equalsIgnoreCase("roleAnonymous"))
				return "tdjd_fail";
			return "tdjd_success";
		} catch (Exception e) {
			setErrMessage(e.getMessage(), e);
			return ERROR;
		}
	}
	public WebSite getWebSite() {
		return webSite;
	}
	public void setWebSite(WebSite webSite) {
		this.webSite = webSite;
	}
	
}
